Micron Document
🎖️GitЯра🎖️


Displaying Raw • Download

core/database/src/commonMain/kotlin/org/meshtastic/core/database/DatabaseBuilder.kt 41414f832f938b655c97bc07509bc140ea16e2a3 (41414f83) Text, 1.80 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.database

Tff7b72import T7ee787androidx.datastore.core.DataStore
Tff7b72import T7ee787androidx.datastore.preferences.core.Preferences
Tff7b72import T7ee787androidx.room3.RoomDatabase
Tff7b72import T7ee787okio.FileSystem
Tff7b72import T7ee787okio.Path

T8b949e/** Returns a [RoomDatabase.Builder] configured for the current platform with the given [dbName]. */
Tff7b72expect Tff7b72fun Td2a8ffgetDatabaseBuilderTb4b4b4(Te6edf3dbNameTb4b4b4: Tffa657StringTb4b4b4)Tb4b4b4: Te6edf3RoomDatabaseTb4b4b4.Te6edf3BuilderTff7b72<Te6edf3MeshtasticDatabaseTff7b72>

T8b949e/** Returns a [RoomDatabase.Builder] configured for an in-memory database on the current platform. */
Tff7b72expect Tff7b72fun Td2a8ffgetInMemoryDatabaseBuilderTb4b4b4(Tb4b4b4)Tb4b4b4: Te6edf3RoomDatabaseTb4b4b4.Te6edf3BuilderTff7b72<Te6edf3MeshtasticDatabaseTff7b72>

T8b949e/** Returns the platform-specific directory where database files are stored. */
Tff7b72expect Tff7b72fun Td2a8ffgetDatabaseDirectoryTb4b4b4(Tb4b4b4)Tb4b4b4: Te6edf3Path

T8b949e/** Deletes the database with the given [dbName] and its associated files (e.g., -wal, -shm). */
Tff7b72expect Tff7b72fun Td2a8ffdeleteDatabaseTb4b4b4(Te6edf3dbNameTb4b4b4: Tffa657StringTb4b4b4)

T8b949e/** Returns the [FileSystem] to use for database file operations. */
Tff7b72expect Tff7b72fun Td2a8ffgetFileSystemTb4b4b4(Tb4b4b4)Tb4b4b4: Te6edf3FileSystem

T8b949e/** Creates a platform-specific [DataStore] for database-related preferences. */
Tff7b72expect Tff7b72fun Td2a8ffcreateDatabaseDataStoreTb4b4b4(Te6edf3nameTb4b4b4: Tffa657StringTb4b4b4)Tb4b4b4: Te6edf3DataStoreTff7b72<Te6edf3PreferencesTff7b72>

Served by rngit 1.5.0 - Generated in 0.04s